package com.turing.post.cardtransactions.util;

import java.math.BigInteger;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.cardmanagement.util.ActivateCard;
import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 卡事务业务逻辑接口定义 实现诸如查询余额、改密码、交易前检查、支付/取消等业务逻辑
 * 
 * @author yxb
 * 
 */

@Remote
@Local
public interface CardTransBusiness {

	/**
	 * 根据卡号及密码查询、校验卡信息
	 * 
	 * @param CardNo
	 *            卡号
	 * @param Pwd
	 *            密码
	 * @param Amount
	 *            发生额
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public ActivateCard getValidActivateCard(String CardNo, String Pwd,
			BigInteger Amount) throws PCPSApplicationException;

	/**
	 * 校验卡密码相关信息
	 * 
	 * @param CardNo
	 * @param Pwd
	 * @throws PCPSApplicationException
	 */
	public void verifyCardPassword(String CardNo, String Pwd)
			throws PCPSApplicationException;

	/**
	 * 变更卡密码业务逻辑
	 * 
	 * @param webInput
	 * 
	 * @param cardNo
	 *            卡号
	 * @param oldPwd
	 *            老密码
	 * @param newPwd
	 *            新密码
	 * @param operId
	 *            操作员ID(可选)
	 * @param remark
	 *            摘要(必须要选)
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public String ChangePassword(String cardNo, String oldPwd, String newPwd,
			BigInteger operId, String remark) throws PCPSApplicationException;

	/**
	 * 修改卡密码(收费)
	 * 
	 * @param webInput
	 * @param rpObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public ResetPasswordObject ChangePasswordCharge(PCPSWebInput webInput,
			ResetPasswordObject rpObj) throws PCPSApplicationException;

	/**
	 * 重置密码
	 * 
	 * @param webInput
	 * 
	 * @param rpObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public ResetPasswordObject ResetPassword(PCPSWebInput webInput,
			ResetPasswordObject rpObj) throws PCPSApplicationException;

	/**
	 * 卡延期
	 * 
	 * @param webInput
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public ExtendExpiredObject ExtendExpired(PCPSWebInput webInput,
			ExtendExpiredObject eeObj) throws PCPSApplicationException;

	/**
	 * 挂失补发新卡
	 * 
	 * @param webInput
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public IssueNewCardObject LossReIssueNewCard(PCPSWebInput webInput,
			IssueNewCardObject eeObj) throws PCPSApplicationException;

	/**
	 * 换发新卡
	 * 
	 * @param webInput
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public IssueNewCardObject ReIssueNewCard(PCPSWebInput webInput,
			IssueNewCardObject eeObj) throws PCPSApplicationException;

	/**
	 * 变更卡种类
	 * 
	 * @param webInput
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public ChangeCardClassicObject ChangeCardClassic(PCPSWebInput webInput,
			ChangeCardClassicObject eeObj) throws PCPSApplicationException;

	/**
	 * 冻结
	 * 
	 * @param webInput
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public FreezeAccountObject FreezeAccount(PCPSWebInput webInput,
			FreezeAccountObject eeObj) throws PCPSApplicationException;

	/**
	 * 批量卡冻结
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public FreezeAccountObject batchFreezeAccount(PCPSWebInput input,
			FreezeAccountObject eeObj) throws PCPSApplicationException;

	/**
	 * 解冻结
	 * 
	 * @param webInput
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public FreezeAccountObject UnFreezeAccount(PCPSWebInput webInput,
			FreezeAccountObject eeObj) throws PCPSApplicationException;

	/**
	 * 批量卡解冻结
	 * 
	 * @param eeObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public FreezeAccountObject batchUnFreezeAccount(PCPSWebInput input,
			FreezeAccountObject eeObj) throws PCPSApplicationException;

	/**
	 * 验证赎回单卡赎回信息
	 * 
	 * @param webInput
	 * 
	 * @param rdObj
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public RedempObject VerifyCardRedempOrder(RedempObject rdObj)
			throws PCPSApplicationException;

	/**
	 * 赎回单确认(只验证,增加本单资金为待审核)
	 * 
	 * @param redempOrderId
	 *            赎回单ID
	 * @throws PCPSApplicationException
	 */
	public void ConfirmRedempOrder(BigInteger redempOrderId)
			throws PCPSApplicationException;

	/**
	 * 赎回单确认取消或撤销(只验证,减少本单待审核资金)
	 * 
	 * @param redempOrderId
	 *            赎回单ID
	 * @throws PCPSApplicationException
	 */
	public void CancelConfirmRedempOrder(PCPSWebInput webInput,
			BigInteger redempOrderId) throws PCPSApplicationException;

	/**
	 * 赎回单扣款记帐
	 * 
	 * @param redempOrderId
	 *            赎回单ID
	 * @param operId
	 *            操作员ID
	 * @throws PCPSApplicationException
	 */
	public void AccountRedempOrder(BigInteger redempOrderId, BigInteger operId)
			throws PCPSApplicationException;

	/**
	 * 验证卡的最大可充值额度
	 * 
	 * @param mrchDepositObject
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public MrchDepositObject MrchDepositValidate(
			MrchDepositObject mrchDepositObject)
			throws PCPSApplicationException;

	/**
	 * 单卡商户充值
	 * 
	 * @param mrchDepositObject
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public MrchDepositObject MrchDeposit(MrchDepositObject mrchDepositObject)
			throws PCPSApplicationException;

	/**
	 * 单卡商户充值撤销
	 * 
	 * @param mrchDepositObject
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public MrchDepositObject CancelMrchDeposit(
			MrchDepositObject mrchDepositObject)
			throws PCPSApplicationException;

	/**
	 * 单卡商户充值重做
	 * 
	 * @param mrchDepositObject
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public MrchDepositObject redoMrchDeposit(MrchDepositObject mrchDepositObject)
			throws PCPSApplicationException;

	/**
	 * 单卡销售机构现金充值
	 * 
	 * @param webInput
	 * 
	 * @param depositObject
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public CashDepositObject CashDeposit(PCPSWebInput webInput,
			CashDepositObject depositObject) throws PCPSApplicationException;

	/**
	 * 单卡销售机构现金充值撤销
	 * 
	 * @param webInput
	 * 
	 * @param depositObject
	 *            入口参数
	 * @throws PCPSApplicationException
	 */
	public CashDepositObject CancelCashDeposit(PCPSWebInput webInput,
			CashDepositObject depositObject) throws PCPSApplicationException;

	/**
	 * 充值单记帐
	 * 
	 * @param webInput
	 * 
	 * @param depositOrderId
	 *            充值单ID
	 * @param operId
	 *            操作员ID
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public void AccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId)
			throws PCPSApplicationException;

	/**
	 * 撤销充值单记帐
	 * 
	 * @param webInput
	 * 
	 * @param depositOrderId
	 *            充值单ID
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            撤销原因或备注
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public void CancelAccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId, String remark)
			throws PCPSApplicationException;

	/**
	 * 审核已记帐充值单
	 * 
	 * @param webInput
	 * 
	 * @param depositOrderId
	 *            充值单ID
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            审核通过原因或备注
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public void AuthAccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId, String remark)
			throws PCPSApplicationException;

	/**
	 * 撤销审核已记帐充值单
	 * 
	 * @param depositOrderId
	 *            充值单ID
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            审核通过原因或备注
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public void CancelAuthAccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId, String remark)
			throws PCPSApplicationException;

	/**
	 * 批量卡支付接口
	 * 
	 * @param paidParam
	 *            支付参数
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public PaidResult Paid(PaidParam paidParam) throws PCPSApplicationException;

	/**
	 * 支付取消
	 * 
	 * @param paidParam
	 *            支付参数
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public PaidResult PaidCancel(PaidParam paidParam)
			throws PCPSApplicationException;

	/**
	 * 重做支付记帐
	 * 
	 * @param paidParam
	 *            支付参数
	 * @throws PCPSApplicationException
	 *             异常信息
	 */
	public PaidResult redoPaid(PaidParam paidParam)
			throws PCPSApplicationException;

	/**
	 * 登记或变更实名信息
	 * 
	 * @param webInput
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param personalId
	 * @param remark
	 * @throws PCPSApplicationException
	 */
	public CardOwnerObject cardAssociateOwnerId(PCPSWebInput webInput,
			CardOwnerObject coObj) throws PCPSApplicationException;

	/**
	 * 卡临时挂失
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardLossObject cardTemporaryLoss(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException;

	/**
	 * 卡解挂失
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardLossObject cardRelieveLoss(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException;

	/**
	 * 卡正式挂失
	 * 
	 * @param webInput
	 * 
	 * @param cardNo
	 * @param remark
	 */
	public CardLossObject cardOfficialLoss(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException;

	/**
	 * 打印单据后修改卡特殊业务事件凭证信息
	 * 
	 * @param webInput
	 * @param cardEventLogId
	 * @param voucherNo
	 * @throws PCPSApplicationException
	 */
	public void updateCardEventLogVoucherNo(PCPSWebInput webInput,
			BigInteger cardEventLogId, String voucherNo, String businessType)
			throws PCPSApplicationException;

	/**
	 * 打印单据后修改卡挂失事件凭证信息
	 * 
	 * @param webInput
	 * @param cardEventLogId
	 * @param voucherNo
	 * @throws PCPSApplicationException
	 */
	public void updateCardLossVoucherNo(PCPSWebInput webInput,
			BigInteger cardLossId, String voucherNo, String businessType)
			throws PCPSApplicationException;

	/**
	 * 检查指定的卡能否在指定的商户处消费
	 * 
	 * @param cardNo
	 * @param merchantNo
	 * @throws PCPSApplicationException
	 */
	public void canCardPaidAtMerchantNo(String cardNo, String merchantNo)
			throws PCPSApplicationException;

	/**
	 * 解除卡密码锁定
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardLossObject resetPwdErrCnt(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException;

	/**
	 * 卡手工锁定
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardLossObject cardManualLock(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException;

	/**
	 * 卡解除手工锁定
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardLossObject cardManualLockFree(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException;

	/**
	 * 卡补磁
	 * 
	 * @param webInput
	 * @param cmObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardMagneticObject cardMagnetic(PCPSWebInput webInput,
			CardMagneticObject cmObj) throws PCPSApplicationException;
}